parallel computing

Loading Data

To load 10x data there a several options with pros an cons.

Normalizing and var Features

##  [1] "Gzma"     "Ccl4"     "Ifitm1"   "Trbv17"   "Ccl1"     "Penk"    
##  [7] "Hbb-bs"   "Hba-a1"   "Ecm1"     "Areg"     "Cxcl2"    "Gcg"     
## [13] "Hba-a2"   "Cxcl10"   "Trbv1"    "Ccl3"     "Trbv15"   "Hbb-bt"  
## [19] "Trbv29"   "Trav8d-2"

PCA

## PC_ 1 
## Positive:  Vps37b, Bhlhe40, Ifrd1, Tnfaip3, Hilpda 
## Negative:  Rps8, Rps20, Rpl28, Rpl10a, Ifi47 
## PC_ 2 
## Positive:  AW112010, Ifi27l2a, Ly6a, S100a11, Cxcr3 
## Negative:  Rpl13, Rps2, Rpl32, Rps5, Igfbp4 
## PC_ 3 
## Positive:  Birc5, Stmn1, Pclaf, Ccna2, Spc24 
## Negative:  Rpl13, Rps4x, Rps5, Rps18, Rpl8 
## PC_ 4 
## Positive:  S100a6, Vim, Lgals3, Nkg7, Crip1 
## Negative:  Izumo1r, Stat1, Cd74, Cd81, Cd83 
## PC_ 5 
## Positive:  Lgals1, Vim, Actg1, S100a10, S100a6 
## Negative:  Zfp36l2, Jun, Evl, Cd7, Btg2

Cluster cells

## 2C_AAACCTGAGTCGAGTG-1 2C_AAACCTGCAGCCAGAA-1 2C_AAACCTGCAGGGCATA-1 
##                     0                     0                     0 
## 2C_AAACCTGCATTTCAGG-1 2C_AAACCTGGTCGCTTCT-1 
##                     0                     0 
## Levels: 0 1 2 3 4 5 6 7 8 9 10 11 12

UMAP

Search for batch effects in clusters

There are some cluster with higher ribosomal gene percentage in clusters 3,6,11 and 12. Cluster 3(12) is a rather spleen specific cluster, while 6 (11) are input cells. The number of counts per cell is especially high in 5,8 (liver/spleen) and

## Scale for 'colour' is already present. Adding another scale for 'colour',
## which will replace the existing scale.

## Scale for 'colour' is already present. Adding another scale for 'colour',
## which will replace the existing scale.

## Vis Treg Genes

Find Diff features

## [1] "gene list ordered by avg_log2FC"

## Selecting by gene
## [1] "gene list ranked by seurat"

Classifying features:

Specific Comparisons:

compare with bulk:

## [1] "colon_vs_liver_vs_cvl"
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 22 rows containing non-finite values (stat_smooth).
## Warning: Removed 22 rows containing missing values (geom_point).
## Warning: Removed 22 rows containing missing values (geom_smooth).
## Warning: Removed 22 rows containing missing values (geom_text_repel).

## [1] "colon_vs_spleen_vs_cvs"
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 22 rows containing non-finite values (stat_smooth).
## Warning: Removed 22 rows containing missing values (geom_point).
## Warning: Removed 25 rows containing missing values (geom_smooth).
## Warning: Removed 22 rows containing missing values (geom_text_repel).

## [1] "liver_vs_spleen_vs_lvs"
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 3 rows containing non-finite values (stat_smooth).
## Warning: Removed 3 rows containing missing values (geom_point).
## Warning: Removed 7 rows containing missing values (geom_smooth).
## Warning: Removed 3 rows containing missing values (geom_text_repel).

TCR visualisation

## [1] "TCRs included: 55\nTCRs leftout: 28"

## [1] "TCRs included: 57\nTCRs leftout: 39"

## [1] "TCRs included: 60\nTCRs leftout: 30"

TCR Clones in specific clusters:

Do analysis separately for alpha-chain, beta-chain and alpha-beta-chain pairs, count on a per cell basis. Do analysis for clusters or tissues, which is joined clusters. Calculate the odds ratio for a TCR clone to be used in cluster 2 versus cluster 0. Or in Colon versus

CellSignature

## Scale for 'colour' is already present. Adding another scale for 'colour',
## which will replace the existing scale.
## Scale for 'colour' is already present. Adding another scale for 'colour',
## which will replace the existing scale.
## Scale for 'colour' is already present. Adding another scale for 'colour',
## which will replace the existing scale.
## Scale for 'colour' is already present. Adding another scale for 'colour',
## which will replace the existing scale.
## Scale for 'colour' is already present. Adding another scale for 'colour',
## which will replace the existing scale.
## Scale for 'colour' is already present. Adding another scale for 'colour',
## which will replace the existing scale.
## Scale for 'colour' is already present. Adding another scale for 'colour',
## which will replace the existing scale.
## Scale for 'colour' is already present. Adding another scale for 'colour',
## which will replace the existing scale.
## Scale for 'colour' is already present. Adding another scale for 'colour',
## which will replace the existing scale.
## Scale for 'colour' is already present. Adding another scale for 'colour',
## which will replace the existing scale.
## Scale for 'colour' is already present. Adding another scale for 'colour',
## which will replace the existing scale.
## Scale for 'colour' is already present. Adding another scale for 'colour',
## which will replace the existing scale.

## Saving 12 x 5 in image

HiSelGenes:

## Warning in DoHeatmap(SObj, features = rownames(i)[1:30], cells = cellspl): The
## following features were omitted as they were not found in the scale.data slot
## for the RNA assay: NA

## Warning in DoHeatmap(SObj, features = rownames(i)[1:30], cells = cellspl): The
## following features were omitted as they were not found in the scale.data slot
## for the RNA assay: NA

## Warning in DoHeatmap(SObj, features = rownames(i)[1:30], cells = cellspl): The
## following features were omitted as they were not found in the scale.data slot
## for the RNA assay: NA

## Warning in DoHeatmap(SObj, features = rownames(i)[1:30], cells = cellspl): The
## following features were omitted as they were not found in the scale.data slot
## for the RNA assay: NA

## Warning in DoHeatmap(SObj, features = rownames(i)[1:30], cells = cellspl): The
## following features were omitted as they were not found in the scale.data slot
## for the RNA assay: NA

## Warning in DoHeatmap(SObj, features = rownames(i)[1:30], cells = cellspl): The
## following features were omitted as they were not found in the scale.data slot
## for the RNA assay: NA

## Welcome to enrichR
## Checking connection ...
## Enrichr ... Connection is Live!
## FlyEnrichr ... Connection is available!
## WormEnrichr ... Connection is available!
## YeastEnrichr ... Connection is available!
## FishEnrichr ... Connection is available!
## Uploading data to Enrichr... Done.
##   Querying Mouse_Gene_Atlas... Done.
##   Querying ARCHS4_Tissues... Done.
## Parsing results... Done.
## Uploading data to Enrichr... Done.
##   Querying Mouse_Gene_Atlas... Done.
##   Querying ARCHS4_Tissues... Done.
## Parsing results... Done.
## Uploading data to Enrichr... Done.
##   Querying Mouse_Gene_Atlas... Done.
##   Querying ARCHS4_Tissues... Done.
## Parsing results... Done.
## Uploading data to Enrichr... Done.
##   Querying Mouse_Gene_Atlas... Done.
##   Querying ARCHS4_Tissues... Done.
## Parsing results... Done.
## Uploading data to Enrichr... Done.
##   Querying Mouse_Gene_Atlas... Done.
##   Querying ARCHS4_Tissues... Done.
## Parsing results... Done.
## Uploading data to Enrichr... Done.
##   Querying Mouse_Gene_Atlas... Done.
##   Querying ARCHS4_Tissues... Done.
## Parsing results... Done.
## Uploading data to Enrichr... Done.
##   Querying Mouse_Gene_Atlas... Done.
##   Querying ARCHS4_Tissues... Done.
## Parsing results... Done.
## Uploading data to Enrichr... Done.
##   Querying Mouse_Gene_Atlas... Done.
##   Querying ARCHS4_Tissues... Done.
## Parsing results... Done.
## Uploading data to Enrichr... Done.
##   Querying Mouse_Gene_Atlas... Done.
##   Querying ARCHS4_Tissues... Done.
## Parsing results... Done.
## Uploading data to Enrichr... Done.
##   Querying Mouse_Gene_Atlas... Done.
##   Querying ARCHS4_Tissues... Done.
## Parsing results... Done.
## Uploading data to Enrichr... Done.
##   Querying Mouse_Gene_Atlas... Done.
##   Querying ARCHS4_Tissues... Done.
## Parsing results... Done.
## Uploading data to Enrichr... Done.
##   Querying Mouse_Gene_Atlas... Done.
##   Querying ARCHS4_Tissues... Done.
## Parsing results... Done.
## Uploading data to Enrichr... Done.
##   Querying Mouse_Gene_Atlas... Done.
##   Querying ARCHS4_Tissues... Done.
## Parsing results... Done.
name Mouse_Gene_Atlas ARCHS4_Tissues
SeuratClust_0 macrophage peri LPS thio 1hrs;macrophage bone marrow 2hr LPS;T-cells foxP3+ REGULATORY T CELLS
SeuratClust_1 T-cells CD8+;NK cells;dendritic plasmacytoid B220+ NATURAL KILLER CELLS
SeuratClust_2 macrophage peri LPS thio 1hrs;macrophage bone marrow 2hr LPS;adrenal gland ALVEOLAR MACROPHAGE
SeuratClust_3 NA;NA;NA HUMAN ZYGOTE
SeuratClust_4 dendritic plasmacytoid B220+;mast cells;NA NATURAL KILLER CELLS
SeuratClust_5 intestine small;adipose white;MEF CORD BLOOD
SeuratClust_6 Baf3;mast cells;osteoblast day14 KIDNEY (BULK TISSUE)
SeuratClust_7 macrophage peri LPS thio 7hrs;macrophage bone marrow 6hr LPS;lymph nodes PLASMACYTOID DENDRITIC CELL
SeuratClust_8 bone marrow;bone;mega erythrocyte progenitor KIDNEY (BULK TISSUE)
SeuratClust_9 microglia;spleen;macrophage bone marrow 24h LPS MACROPHAGE
SeuratClust_10 macrophage peri LPS thio 7hrs;macrophage bone marrow 6hr LPS;macrophage peri LPS thio 1hrs PLASMACYTOID DENDRITIC CELL
SeuratClust_11 bone marrow;mega erythrocyte progenitor;embryonic stem line V26 2 p16 KIDNEY (BULK TISSUE)
SeuratClust_12 bone marrow;bone;mega erythrocyte progenitor KIDNEY (BULK TISSUE)

fgsea from clusters summarized in tissues

## [1] "pathways for: colon_vs_liver"
## Warning in fgsea(pathways = pathwayset, stats = rank, minSize = 15, maxSize
## = 500, : You are trying to run fgseaSimple. It is recommended to use
## fgseaMultilevel. To run fgseaMultilevel, you need to remove the nperm argument
## in the fgsea function call.
## [1] "pathways for: colon_vs_spleen"
## Warning in fgsea(pathways = pathwayset, stats = rank, minSize = 15, maxSize
## = 500, : You are trying to run fgseaSimple. It is recommended to use
## fgseaMultilevel. To run fgseaMultilevel, you need to remove the nperm argument
## in the fgsea function call.

## [1] "pathways for: liver_vs_spleen"
## Warning in fgsea(pathways = pathwayset, stats = rank, minSize = 15, maxSize
## = 500, : You are trying to run fgseaSimple. It is recommended to use
## fgseaMultilevel. To run fgseaMultilevel, you need to remove the nperm argument
## in the fgsea function call.

Fgsea from clusters

## [1] "pathways for: 0"
## Warning in fgsea(pathways = pathwayset, stats = rank, minSize = 15, maxSize
## = 500, : You are trying to run fgseaSimple. It is recommended to use
## fgseaMultilevel. To run fgseaMultilevel, you need to remove the nperm argument
## in the fgsea function call.
## [1] "pathways for: 1"
## Warning in fgsea(pathways = pathwayset, stats = rank, minSize = 15, maxSize
## = 500, : You are trying to run fgseaSimple. It is recommended to use
## fgseaMultilevel. To run fgseaMultilevel, you need to remove the nperm argument
## in the fgsea function call.
## [1] "pathways for: 2"
## Warning in fgsea(pathways = pathwayset, stats = rank, minSize = 15, maxSize
## = 500, : You are trying to run fgseaSimple. It is recommended to use
## fgseaMultilevel. To run fgseaMultilevel, you need to remove the nperm argument
## in the fgsea function call.
## [1] "pathways for: 3"
## Warning in fgsea(pathways = pathwayset, stats = rank, minSize = 15, maxSize
## = 500, : You are trying to run fgseaSimple. It is recommended to use
## fgseaMultilevel. To run fgseaMultilevel, you need to remove the nperm argument
## in the fgsea function call.

## [1] "pathways for: 4"
## Warning in fgsea(pathways = pathwayset, stats = rank, minSize = 15, maxSize
## = 500, : You are trying to run fgseaSimple. It is recommended to use
## fgseaMultilevel. To run fgseaMultilevel, you need to remove the nperm argument
## in the fgsea function call.
## [1] "pathways for: 5"
## Warning in fgsea(pathways = pathwayset, stats = rank, minSize = 15, maxSize
## = 500, : You are trying to run fgseaSimple. It is recommended to use
## fgseaMultilevel. To run fgseaMultilevel, you need to remove the nperm argument
## in the fgsea function call.

## [1] "pathways for: 6"
## Warning in fgsea(pathways = pathwayset, stats = rank, minSize = 15, maxSize
## = 500, : You are trying to run fgseaSimple. It is recommended to use
## fgseaMultilevel. To run fgseaMultilevel, you need to remove the nperm argument
## in the fgsea function call.

## [1] "pathways for: 7"
## Warning in fgsea(pathways = pathwayset, stats = rank, minSize = 15, maxSize
## = 500, : You are trying to run fgseaSimple. It is recommended to use
## fgseaMultilevel. To run fgseaMultilevel, you need to remove the nperm argument
## in the fgsea function call.

## [1] "pathways for: 8"
## Warning in fgsea(pathways = pathwayset, stats = rank, minSize = 15, maxSize
## = 500, : You are trying to run fgseaSimple. It is recommended to use
## fgseaMultilevel. To run fgseaMultilevel, you need to remove the nperm argument
## in the fgsea function call.

## [1] "pathways for: 9"
## Warning in fgsea(pathways = pathwayset, stats = rank, minSize = 15, maxSize
## = 500, : You are trying to run fgseaSimple. It is recommended to use
## fgseaMultilevel. To run fgseaMultilevel, you need to remove the nperm argument
## in the fgsea function call.

## [1] "pathways for: 10"
## Warning in fgsea(pathways = pathwayset, stats = rank, minSize = 15, maxSize
## = 500, : You are trying to run fgseaSimple. It is recommended to use
## fgseaMultilevel. To run fgseaMultilevel, you need to remove the nperm argument
## in the fgsea function call.
## [1] "pathways for: 11"
## Warning in fgsea(pathways = pathwayset, stats = rank, minSize = 15, maxSize
## = 500, : You are trying to run fgseaSimple. It is recommended to use
## fgseaMultilevel. To run fgseaMultilevel, you need to remove the nperm argument
## in the fgsea function call.

## [1] "pathways for: 12"
## Warning in fgsea(pathways = pathwayset, stats = rank, minSize = 15, maxSize
## = 500, : You are trying to run fgseaSimple. It is recommended to use
## fgseaMultilevel. To run fgseaMultilevel, you need to remove the nperm argument
## in the fgsea function call.

## Registered S3 methods overwritten by 'ggalt':
##   method                  from   
##   grid.draw.absoluteGrob  ggplot2
##   grobHeight.absoluteGrob ggplot2
##   grobWidth.absoluteGrob  ggplot2
##   grobX.absoluteGrob      ggplot2
##   grobY.absoluteGrob      ggplot2

## Warning: Removed 1 rows containing missing values (geom_text_repel).

Publication Figures:

# Violin plots per cluster 2-4 genes for each cluster

compare with bulk:

Session Info

## R version 4.0.3 (2020-10-10)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Debian GNU/Linux 10 (buster)
## 
## Matrix products: default
## BLAS/LAPACK: /misc/software/package/RBioC/libmkl/R-4.0.3_buster_intel-mkl-64bit-2020.1-102_build/compilers_and_libraries_2020.1.217/linux/mkl/lib/intel64_lin/libmkl_gf_lp64.so
## 
## locale:
##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
##  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
##  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
##  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
##  [1] EnhancedVolcano_1.8.0 msigdbr_7.4.1         BiocParallel_1.24.1  
##  [4] enrichR_3.0           reshape2_1.4.4        ggrepel_0.9.1        
##  [7] fgsea_1.16.0          dplyr_1.0.3           patchwork_1.1.1      
## [10] ggplot2_3.3.3         cowplot_1.1.1         RColorBrewer_1.1-2   
## [13] future_1.21.0         knitr_1.30            SeuratObject_4.0.0   
## [16] Seurat_4.0.0          rmarkdown_2.6        
## 
## loaded via a namespace (and not attached):
##   [1] ggbeeswarm_0.6.0     Rtsne_0.15           colorspace_2.0-0    
##   [4] rjson_0.2.20         deldir_0.2-9         ellipsis_0.3.1      
##   [7] ggridges_0.5.3       spatstat.data_1.7-0  leiden_0.3.7        
##  [10] listenv_0.8.0        farver_2.0.3         codetools_0.2-16    
##  [13] splines_4.0.3        extrafont_0.17       polyclip_1.10-0     
##  [16] jsonlite_1.7.2       Rttf2pt1_1.3.8       ica_1.0-2           
##  [19] cluster_2.1.0        png_0.1-7            uwot_0.1.10         
##  [22] shiny_1.6.0          sctransform_0.3.2    compiler_4.0.3      
##  [25] httr_1.4.2           assertthat_0.2.1     Matrix_1.2-18       
##  [28] fastmap_1.1.0        lazyeval_0.2.2       later_1.1.0.1       
##  [31] htmltools_0.5.1.1    tools_4.0.3          igraph_1.2.6        
##  [34] gtable_0.3.0         glue_1.4.2           RANN_2.6.1          
##  [37] maps_3.3.0           fastmatch_1.1-0      Rcpp_1.0.6          
##  [40] spatstat_1.64-1      scattermore_0.7      vctrs_0.3.6         
##  [43] ggalt_0.4.0          babelgene_21.4       nlme_3.1-149        
##  [46] extrafontdb_1.0      lmtest_0.9-38        xfun_0.20           
##  [49] stringr_1.4.0        globals_0.14.0       mime_0.9            
##  [52] miniUI_0.1.1.1       lifecycle_0.2.0      irlba_2.3.3         
##  [55] goftest_1.2-2        MASS_7.3-53          zoo_1.8-8           
##  [58] scales_1.1.1         promises_1.1.1       spatstat.utils_2.0-0
##  [61] proj4_1.0-10.1       parallel_4.0.3       yaml_2.2.1          
##  [64] curl_4.3             reticulate_1.18      pbapply_1.4-3       
##  [67] gridExtra_2.3        ggrastr_0.2.3        rpart_4.1-15        
##  [70] stringi_1.5.3        highr_0.8            rlang_0.4.10        
##  [73] pkgconfig_2.0.3      matrixStats_0.57.0   evaluate_0.14       
##  [76] lattice_0.20-41      ROCR_1.0-11          purrr_0.3.4         
##  [79] tensor_1.5           htmlwidgets_1.5.3    labeling_0.4.2      
##  [82] tidyselect_1.1.0     parallelly_1.23.0    RcppAnnoy_0.0.18    
##  [85] plyr_1.8.6           magrittr_2.0.1       R6_2.5.0            
##  [88] generics_0.1.0       DBI_1.1.1            pillar_1.4.7        
##  [91] withr_2.4.1          mgcv_1.8-33          fitdistrplus_1.1-3  
##  [94] ash_1.0-15           survival_3.2-7       abind_1.4-5         
##  [97] tibble_3.0.5         future.apply_1.7.0   crayon_1.3.4        
## [100] KernSmooth_2.23-17   plotly_4.9.3         grid_4.0.3          
## [103] data.table_1.13.6    digest_0.6.27        xtable_1.8-4        
## [106] tidyr_1.1.2          httpuv_1.5.5         munsell_0.5.0       
## [109] beeswarm_0.2.3       viridisLite_0.3.0    vipor_0.4.5